﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using diploma.core.GUI;
using diploma.core.localize;
using diploma.core.data;

namespace diploma.editor
{
    public partial class EditorForm : DiplomaForm
    {
        public EditorForm(Form _parent, AbstractLocalizator _localizator, params DataList<diploma.core.data.IDataObject>[] _dataObjectsCollection)
            : base(_parent, _localizator, _dataObjectsCollection)
        {
            this.editorControl = new EditorControl(_localizator, dataObjectsCollections);
            this.editorControl.Width = this.Width;
            this.editorControl.Height = this.Height;
            this.editorControl.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Left;
            this.Controls.Add(editorControl);
        }

        protected override void fillMainMenuElements()
        {
            base.fillMainMenuElements();
            ToolStripMenuItem _meditor = new ToolStripMenuItem("menu.editor");
            _meditor.DropDownItems.Add(new ToolStripMenuItem("menu.editor.open", null, new EventHandler(openForm), "miOpenEditorForm"));
            mainMenuElements.Add(_meditor);
        }

        private void openForm(object sender, EventArgs e)
        {
            this.Show();
        }

        protected override void fillStatusBarElements()
        {
            base.fillStatusBarElements();
        }

        protected override void fillToolBarElements()
        {
            base.fillToolBarElements();
        }

        public override void Localize()
        {
            this.Text = localizator.GetLocolizeWord(this.Text);
        }
    }
}
